package com.du.service.impl;

import com.du.dao.BookDAO;
import com.du.dao.impl.BookDAOImpl;
import com.du.pojo.Book;
import com.du.service.BookService;

import java.util.List;

/**
 * @author : DuJiabao
 * @Date : 2021/2/1 23:14
 * @Project : bookstore
 * @File : null.java
 * @Desc :
 */
public class BookServiceImpl implements BookService {

    BookDAO bookDAO = new BookDAOImpl();

    @Override
    public int updateBook(Book book) {
        return bookDAO.updateBook(book);
    }

    @Override
    public int deleteBook(int id) {
        return bookDAO.deleteBook(id);
    }

    @Override
    public int addBook(Book book) {
        return bookDAO.saveBook(book);
    }

    @Override
    public List<Book> bookList() {
        return bookDAO.queryBookList();
    }

    @Override
    public Book getBook(int id) {
        return bookDAO.queryBook(id);
    }
}
